package com.example.springbootparamvalidatedemo.dto;

import com.example.springbootparamvalidatedemo.constant.BaseConstant;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author chaird
 * @create 2021-06-18 22:03
 */
@Data
public class TeacherDto {

  @NotNull(
      message = "id不能为空",
      groups = {BaseConstant.Update.class})
  private Integer id;

  @NotBlank(
      message = "name不能为空",
      groups = {BaseConstant.Update.class, BaseConstant.Insert.class})
  private String name;

  @NotBlank(
      message = "email不能为空",
      groups = {BaseConstant.Update.class, BaseConstant.Insert.class})
  private String email;
}
